<?php
    define('SEP', ' &lt; ');
    $this->load->library('Tree', array('table' => 'tree'));
    $BREADCRUMBS = $this->tree->getAllParentNodes($this->uri->segment(3));
    $TYPES = $this->db->get('types')->result_array();
    //print nl2br(print_r($BREADCRUMBS, true));    
    /*$TREE = $this->db->where('active', 1)
        ->where('parent_id <> 0')
        ->get('tree')->result_array();*/
    $max = count($BREADCRUMBS);
    $i = 0;
    print anchor('', 'Главная');
    if($max > 0) print SEP;                
    foreach($BREADCRUMBS as $item) {                
        print anchor($TYPES[$item['type_id'] - 1]['typename'].'/view/'.$item['id'], $item['title']);
        if($i < ($max - 1) && $max > 0) print SEP;
        $i++;                        
    }
?>